<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
     <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <style>
        .row{margin:0;padding: 0}
        .btn{margin:0 10px;}
        .aprovalSystemTable thead th{text-align: center;}
    </style>

</head>

<body class="white-bg" style="color:#333;padding:3px;">
      <div class="page-heade">
       <h2 class="title_color text-center">请选择网点对应的系统</h2>
    </div>
   <form action="" class="form-group" id="form1">
           <table class="table table-bordered white-bg">
            <tr>
            <td style="text-align: right;"><label for="title">系统编号：</label></td>
            <td><input type="text" class="form-control inputremindPeple" id="sn" name="sn" value="{$sn}"></td>
             <td style="text-align: right;"><label for="title">系统名称：</label></td>
            <td><input type="text" class="form-control inputremindPeple" id="title" name="title" value="{$title}"></td>
              <td colspan="2"><button class="btn btn-info">查询</button> <button class="btn btn-info emtyif" id="reset">清空查询条件</button></td>
            </tr>

      </table>
   </form>
      <form action="">
			 <table class="table table-bordered table-hover text-center aprovalSystemTable">
                <thead>
                    <tr class="info">
                        <th>No.</th>
                        <th>系统编号</th>
                        <th>系统名称</th>
                        <th>选择</th>
                    </tr>
                </thead>
                <tbody>
                {volist name="data" id="row" key="key"}
                <tr>
					<td class="NoId">{$key}</td>
					<td>{$row.sn}</td>
					<td>{$row.title}</td>
					<td><a href="javascript:;" class="change_this" data-link="{:url('add',array('system_id'=>$row.id))}">选择</a></td>
                </tr>
                 {/volist}
                </tbody>
        </table>
      </form>
    </div>

    {include file="Public/footer"}
    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script>
        $(document).ready(function(){
            $(".addAprolvalWarn").click(function() {
                layer.open({
                    type: 2,
                    title: '&nbsp;',
                    shadeClose: true,
                    shade: false,
                    maxmin: true, //开启最大化最小化按钮
                    area: ['800px', '600px'],
                    content: 'http://localhost/xiaolutong/xiaolutong/system/setRemindPeople.html'
                })
            });
            $(".aprovalSystemTable").on("click",".change_this",function(){
                var link = $(this).data('link')
                var str=$(this).parent().prev().find(".netName").html()
                swal({
                    title: "",
                    text: "确定选择名字为("+str+")的系统吗？",
                    type: "warning",
                    showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                     confirmButtonText: "确定",
                    closeOnConfirm: false
                },
                function(){
                    location.href = link;
                });
            })
        });
    </script>
    <script>
        $(function () {
            $('#reset').on('click',function () {
                $('#form1 input').each(function (i,o) {
                    $(o).val('')
                })
                $('#form1').submit()
                return false
            })
        })
    </script>
</body>

</html>